package com.example.asus.shixun2.model;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

import com.example.asus.shixun2.Tool;

/**
 * Created by ASUS on 2019/1/2.
 */
public class ScoreModel {


    Paint score_paint;//声明分数画笔
    int boxSize;
    public Paint line_paint;//声明辅助线画笔
    Paint next_boxs;//声明下一块字体画笔


    public ScoreModel(int boxSize){
        this.boxSize = boxSize;
        initPaint();
    }

    private void initPaint() {
        score_paint = new Paint();//初始化分数画笔
        score_paint.setColor(Color.WHITE);
        score_paint.setTextSize(30);
        score_paint.setAntiAlias(true);//打开抗锯齿
        //辅助线画笔
        line_paint = new Paint();//初始化辅助线画笔
        line_paint.setColor(Color.WHITE);
        line_paint.setAntiAlias(true);//打开抗锯齿
        //下一快字体画笔
        next_boxs = new Paint();
        next_boxs.setColor(Color.WHITE);
        next_boxs.setTextSize(40);
        next_boxs.setAntiAlias(true);
    }

    /**画出下一块字体*/
    public void drawNext_boxs(Canvas canvas){
        canvas.drawText("下一块:",7,35,next_boxs);
    }

    /**画出分数*/
    public void drawScore(Canvas canvas){
        canvas.drawText("分数:" + Tool.score,5,230,score_paint);
    }

    /**画出方块预览辅助线*/
    public void drawNextLine(Canvas canvas){
        for(int x = 0;x < 7;x ++){
            canvas.drawLine(x*24,2*24,x*24,8*24,line_paint);
        }
        for(int y = 2;y < 9;y ++){
            canvas.drawLine(0,y*24,6*24,y*24,line_paint);
        }
    }

}
